package com.flying.set;

import java.util.LinkedHashSet;
import java.util.LinkedList;
import java.util.Set;

/**
 * @author 刘鹏飞
 * @ClassName LinkedHashSetTest
 * @Date 2025/1/5 21:06
 * @Created by 刘鹏飞
 * @Description
 *  测试 LinkedHashSet
 *
 *  有序性: 与在HashSet的基础上增加了一条双向链表,用来维护元素的顺序
 *
 *  不可重复性
 *
 *
 *
 */
public class LinkedHashSetTest {

    public static void main(String[] args) {


        LinkedHashSet<Users> set=new LinkedHashSet<>();


        Users user = new Users("黄忠",18);
        Users user1 = new Users("马超",24);
        Users user2 = new Users("关羽",65);
        Users user3 = new Users("赵云",34);
        Users user4 = new Users("张飞",34);
        Users user5 = new Users("张飞",34);


        set.add(user);
        set.add(user1);
        set.add(user2);
        set.add(user3);
        set.add(user4);
        set.add(user5);  // 添加成功











    }
}
